package com.hopu.proxy.cglib;

import com.hopu.proxy.CellphoneFactory;
import com.hopu.proxy.CellphoneSales;
import com.hopu.proxy.computer.ComputerFactory;
import com.hopu.proxy.computer.ComputerSales;

public class CGLibTest {

    public static void main(String[] args) {
        CellphoneSales factory1 = new CellphoneFactory();
        ComputerSales factory2 = new ComputerFactory();

        CGLibProxy proxy = new CGLibProxy();

        CellphoneSales proxy1 = (CellphoneSales) proxy.createProxy(factory1);
        proxy1.sellCellphone("Vivo");

        ComputerSales proxy2 = (ComputerSales) proxy.createProxy(factory2);
        proxy2.sellComputer("Lenovo");
    }
}
